/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package SimpleQM.impl;

import SimpleQM.QElement;
import SimpleQM.QoS;
import SimpleQM.QoSCharacteristic;
import SimpleQM.QoSType;
import SimpleQM.QoS_availability;
import SimpleQM.QoS_costs;
import SimpleQM.QoS_disasterRecovery;
import SimpleQM.QoS_latency;
import SimpleQM.QoS_security;
import SimpleQM.QualitativeValue;
import SimpleQM.Root;
import SimpleQM.SimpleQMFactory;
import SimpleQM.SimpleQMPackage;

import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EEnum;
import org.eclipse.emf.ecore.EGenericType;
import org.eclipse.emf.ecore.EOperation;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;

import org.eclipse.emf.ecore.impl.EPackageImpl;
import org.eclipse.ocl.ecore.EcorePackage;
import org.eclipse.ocl.expressions.ExpressionsPackage;
import org.eclipse.ocl.types.TypesPackage;
import org.eclipse.ocl.utilities.UtilitiesPackage;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Package</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class SimpleQMPackageImpl extends EPackageImpl implements SimpleQMPackage {
	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass rootEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass qElementEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass qoSEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass qoSCharacteristicEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass qoS_latencyEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass qoS_availabilityEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass qoS_disasterRecoveryEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass qoS_securityEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass qoS_costsEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EEnum qoSTypeEEnum = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EEnum qualitativeValueEEnum = null;

	/**
	 * Creates an instance of the model <b>Package</b>, registered with
	 * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
	 * package URI value.
	 * <p>Note: the correct way to create the package is via the static
	 * factory method {@link #init init()}, which also performs
	 * initialization of the package, or returns the registered package,
	 * if one already exists.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see org.eclipse.emf.ecore.EPackage.Registry
	 * @see SimpleQM.SimpleQMPackage#eNS_URI
	 * @see #init()
	 * @generated
	 */
	private SimpleQMPackageImpl() {
		super(eNS_URI, SimpleQMFactory.eINSTANCE);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private static boolean isInited = false;

	/**
	 * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
	 * 
	 * <p>This method is used to initialize {@link SimpleQMPackage#eINSTANCE} when that field is accessed.
	 * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #eNS_URI
	 * @see #createPackageContents()
	 * @see #initializePackageContents()
	 * @generated
	 */
	public static SimpleQMPackage init() {
		if (isInited) return (SimpleQMPackage)EPackage.Registry.INSTANCE.getEPackage(SimpleQMPackage.eNS_URI);

		// Obtain or create and register package
		SimpleQMPackageImpl theSimpleQMPackage = (SimpleQMPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof SimpleQMPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new SimpleQMPackageImpl());

		isInited = true;

		// Initialize simple dependencies
		EcorePackage.eINSTANCE.eClass();

		// Create package meta-data objects
		theSimpleQMPackage.createPackageContents();

		// Initialize created meta-data
		theSimpleQMPackage.initializePackageContents();

		// Mark meta-data to indicate it can't be changed
		theSimpleQMPackage.freeze();

  
		// Update the registry and return the package
		EPackage.Registry.INSTANCE.put(SimpleQMPackage.eNS_URI, theSimpleQMPackage);
		return theSimpleQMPackage;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getRoot() {
		return rootEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getRoot_Components() {
		return (EReference)rootEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getQElement() {
		return qElementEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getQElement_Name() {
		return (EAttribute)qElementEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getQElement_Id() {
		return (EAttribute)qElementEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getQElement_Qos() {
		return (EReference)qElementEClass.getEStructuralFeatures().get(2);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getQoS() {
		return qoSEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getQoS_Type() {
		return (EAttribute)qoSEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getQoS_Characteristic() {
		return (EReference)qoSEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getQoSCharacteristic() {
		return qoSCharacteristicEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getQoSCharacteristic_Constraint() {
		return (EReference)qoSCharacteristicEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getQoSCharacteristic_Value() {
		return (EAttribute)qoSCharacteristicEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getQoS_latency() {
		return qoS_latencyEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getQoS_latency_Latency() {
		return (EAttribute)qoS_latencyEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getQoS_availability() {
		return qoS_availabilityEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getQoS_availability_QValue() {
		return (EAttribute)qoS_availabilityEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getQoS_disasterRecovery() {
		return qoS_disasterRecoveryEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getQoS_disasterRecovery_RecoveryTimeObjective() {
		return (EAttribute)qoS_disasterRecoveryEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getQoS_security() {
		return qoS_securityEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getQoS_security_SecurityLevel() {
		return (EAttribute)qoS_securityEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getQoS_costs() {
		return qoS_costsEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getQoS_costs_Costs() {
		return (EAttribute)qoS_costsEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EEnum getQoSType() {
		return qoSTypeEEnum;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EEnum getQualitativeValue() {
		return qualitativeValueEEnum;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public SimpleQMFactory getSimpleQMFactory() {
		return (SimpleQMFactory)getEFactoryInstance();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private boolean isCreated = false;

	/**
	 * Creates the meta-model objects for the package.  This method is
	 * guarded to have no affect on any invocation but its first.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void createPackageContents() {
		if (isCreated) return;
		isCreated = true;

		// Create classes and their features
		rootEClass = createEClass(ROOT);
		createEReference(rootEClass, ROOT__COMPONENTS);

		qElementEClass = createEClass(QELEMENT);
		createEAttribute(qElementEClass, QELEMENT__NAME);
		createEAttribute(qElementEClass, QELEMENT__ID);
		createEReference(qElementEClass, QELEMENT__QOS);

		qoSEClass = createEClass(QO_S);
		createEAttribute(qoSEClass, QO_S__TYPE);
		createEReference(qoSEClass, QO_S__CHARACTERISTIC);

		qoSCharacteristicEClass = createEClass(QO_SCHARACTERISTIC);
		createEReference(qoSCharacteristicEClass, QO_SCHARACTERISTIC__CONSTRAINT);
		createEAttribute(qoSCharacteristicEClass, QO_SCHARACTERISTIC__VALUE);

		qoS_latencyEClass = createEClass(QO_SLATENCY);
		createEAttribute(qoS_latencyEClass, QO_SLATENCY__LATENCY);

		qoS_availabilityEClass = createEClass(QO_SAVAILABILITY);
		createEAttribute(qoS_availabilityEClass, QO_SAVAILABILITY__QVALUE);

		qoS_disasterRecoveryEClass = createEClass(QO_SDISASTER_RECOVERY);
		createEAttribute(qoS_disasterRecoveryEClass, QO_SDISASTER_RECOVERY__RECOVERY_TIME_OBJECTIVE);

		qoS_securityEClass = createEClass(QO_SSECURITY);
		createEAttribute(qoS_securityEClass, QO_SSECURITY__SECURITY_LEVEL);

		qoS_costsEClass = createEClass(QO_SCOSTS);
		createEAttribute(qoS_costsEClass, QO_SCOSTS__COSTS);

		// Create enums
		qoSTypeEEnum = createEEnum(QO_STYPE);
		qualitativeValueEEnum = createEEnum(QUALITATIVE_VALUE);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private boolean isInitialized = false;

	/**
	 * Complete the initialization of the package and its meta-model.  This
	 * method is guarded to have no affect on any invocation but its first.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void initializePackageContents() {
		if (isInitialized) return;
		isInitialized = true;

		// Initialize package
		setName(eNAME);
		setNsPrefix(eNS_PREFIX);
		setNsURI(eNS_URI);

		// Obtain other dependent packages
		EcorePackage theEcorePackage = (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI);

		// Create type parameters

		// Set bounds for type parameters

		// Add supertypes to classes
		qoS_latencyEClass.getESuperTypes().add(this.getQoSCharacteristic());
		qoS_availabilityEClass.getESuperTypes().add(this.getQoSCharacteristic());
		qoS_disasterRecoveryEClass.getESuperTypes().add(this.getQoSCharacteristic());
		qoS_securityEClass.getESuperTypes().add(this.getQoSCharacteristic());
		qoS_costsEClass.getESuperTypes().add(this.getQoSCharacteristic());

		// Initialize classes and features; add operations and parameters
		initEClass(rootEClass, Root.class, "Root", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEReference(getRoot_Components(), this.getQElement(), null, "components", null, 0, -1, Root.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(qElementEClass, QElement.class, "QElement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEAttribute(getQElement_Name(), ecorePackage.getEString(), "name", "", 0, 1, QElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getQElement_Id(), ecorePackage.getEString(), "id", "", 0, 1, QElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEReference(getQElement_Qos(), this.getQoS(), null, "qos", null, 0, -1, QElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(qoSEClass, QoS.class, "QoS", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEAttribute(getQoS_Type(), this.getQoSType(), "type", null, 0, 1, QoS.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEReference(getQoS_Characteristic(), this.getQoSCharacteristic(), null, "characteristic", null, 0, 1, QoS.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(qoSCharacteristicEClass, QoSCharacteristic.class, "QoSCharacteristic", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEReference(getQoSCharacteristic_Constraint(), theEcorePackage.getConstraint(), null, "constraint", null, 0, 1, QoSCharacteristic.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getQoSCharacteristic_Value(), ecorePackage.getEString(), "value", null, 0, 1, QoSCharacteristic.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(qoS_latencyEClass, QoS_latency.class, "QoS_latency", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEAttribute(getQoS_latency_Latency(), ecorePackage.getEInt(), "latency", null, 0, 1, QoS_latency.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		EOperation op = addEOperation(qoS_latencyEClass, ecorePackage.getEIntegerObject(), "latency", 0, 1, IS_UNIQUE, IS_ORDERED);
		addEParameter(op, ecorePackage.getEString(), "qElement", 0, 1, IS_UNIQUE, IS_ORDERED);

		initEClass(qoS_availabilityEClass, QoS_availability.class, "QoS_availability", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEAttribute(getQoS_availability_QValue(), this.getQualitativeValue(), "qValue", null, 0, 1, QoS_availability.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		op = addEOperation(qoS_availabilityEClass, this.getQualitativeValue(), "qValue", 0, 1, IS_UNIQUE, IS_ORDERED);
		addEParameter(op, ecorePackage.getEString(), "qElement", 0, 1, IS_UNIQUE, IS_ORDERED);

		initEClass(qoS_disasterRecoveryEClass, QoS_disasterRecovery.class, "QoS_disasterRecovery", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEAttribute(getQoS_disasterRecovery_RecoveryTimeObjective(), ecorePackage.getEInt(), "recoveryTimeObjective", null, 0, 1, QoS_disasterRecovery.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		op = addEOperation(qoS_disasterRecoveryEClass, ecorePackage.getEIntegerObject(), "recoveryTimeObjective", 0, 1, IS_UNIQUE, IS_ORDERED);
		addEParameter(op, ecorePackage.getEString(), "qElement", 0, 1, IS_UNIQUE, IS_ORDERED);

		initEClass(qoS_securityEClass, QoS_security.class, "QoS_security", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEAttribute(getQoS_security_SecurityLevel(), this.getQualitativeValue(), "securityLevel", null, 0, 1, QoS_security.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		op = addEOperation(qoS_securityEClass, this.getQualitativeValue(), "securityLevel", 0, 1, IS_UNIQUE, IS_ORDERED);
		addEParameter(op, ecorePackage.getEString(), "qElement", 0, 1, IS_UNIQUE, IS_ORDERED);

		initEClass(qoS_costsEClass, QoS_costs.class, "QoS_costs", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEAttribute(getQoS_costs_Costs(), ecorePackage.getEInt(), "costs", null, 0, 1, QoS_costs.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		op = addEOperation(qoS_costsEClass, ecorePackage.getEIntegerObject(), "costs", 0, 1, IS_UNIQUE, IS_ORDERED);
		addEParameter(op, ecorePackage.getEString(), "qElement", 0, 1, IS_UNIQUE, IS_ORDERED);

		// Initialize enums and add enum literals
		initEEnum(qoSTypeEEnum, QoSType.class, "QoSType");
		addEEnumLiteral(qoSTypeEEnum, QoSType.OFFERED);
		addEEnumLiteral(qoSTypeEEnum, QoSType.REQUIRED);

		initEEnum(qualitativeValueEEnum, QualitativeValue.class, "QualitativeValue");
		addEEnumLiteral(qualitativeValueEEnum, QualitativeValue.LOW);
		addEEnumLiteral(qualitativeValueEEnum, QualitativeValue.MID);
		addEEnumLiteral(qualitativeValueEEnum, QualitativeValue.HIGH);

		// Create resource
		createResource(eNS_URI);
	}

} //SimpleQMPackageImpl
